package com.itheima.sh.a_test_01;

public class MethodDemo01_1 {
    public static void main(String[] args) {
        int[] arr={30,40,50,60};
        int index = getarr(arr, 50);
        System.out.println("index = " + index);
    }

    public static int getarr(int[] arr, int number) {
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]==number){

                return i;
            }
        }
        return -1;
    }
}